 <#include "../common/head.ftl">
<!--contaniner-->
<div id="box">

<!--search-->
 <div class="searchinfo">
 <form action="${base}/search" method="post" id="searchForm">
  	<div class="lf">
          <ul>
              <li><span>学历</span><select name="education" id="education"></select></li>
              <li><span>一级专业</span><select name="major_list" id="major_list"></select></li>
              <li><span>二级专业</span><select name="child_major" id="child_major"><option selected='selected' value='0'>不限</option></select></li>
              <li><span>职位类型</span><select name="job_type" id="job_type"></select></li>
          </ul>
         <ul>
             <li><span>工作经验</span><select name="work_experience" id="work_experience"></select></li>
             <li><span>期望薪资</span><select name="salary" id="salary">
			    <option value="不限" selected="selected" value="0">不限</option>
			    <option value="1000-2000">1000-2000</option>
			    <option value="2001-4000">2001-4000</option>
			    <option value="4001-7000">4001-7000</option>
			    <option value="7001-10000">7001-10000</option>
			    <option value="10001-15000">10001-15000</option>
			    <option value="15001-20000">15001-20000</option>
			    <option value="20001-60000">20001以上</option>
			    <option value="1000-20000">面议</option>
			    </select>
			  </li>
             <li><span>期望城市</span><select name="city" id="city"></select></li>
         </ul>
     </div>
     <div class="rt">
          <ul>
              <li class="resetgray"><button type="reset">重置</button></li>
              <li class="soublue"><button type="button" onclick="search()">搜索</button></li>
          </ul>
     </div>
  </form>
 </div>
 <!--/.search-->
 <!-- new add -->
 <div class="banner-box">
  <div class="bd">
    <ul>
    <#if pic_list??>
		<#list pic_list as pc>
      <li>
        <div class="m-width"> 
        
        <#if pc.jump_type=="1">
        	<a href="javascript:void(0);" onclick="window.open('${pc.source }')">
        <#else>
        	<a href="javascript:void(0);">
        </#if>
        	<img src="${pc.img_url }" alt="" />
        </a> 
       </div>
      </li>
      </#list>
    </#if>
      
    </ul>
  </div>
  <div class="banner-btn"> <a class="prev" href="javascript:return false;"></a> <a class="next" href="javascript:return false;"></a>
    <div class="hd">
      <ul>
      </ul>
    </div>
  </div>
</div>
 <!-- new add end -->
  
 <!--showbox-->
 <div class="showbox">
  <div class="wrap">
  	<p class="subsite-btn">
  	 <#if emergent??>
	 <#list emergent as ee>
	 	<#assign hour=ee.over_time?substring(0,2)>
	 	<#assign min=ee.over_time?substring(3,5)>
	 	<#assign sec=ee.over_time?substring(6,8)>
	  	  <#if enterpriseInit[0].ent_status=="0">
	  	  <a href="javascript:void(0)"onclick="correctEmergent();" id="${result}">
	  	  <#else>
	  	  <a href="javascript:void(0)" onclick="erroremergentMsg();" id="${enterpriseInit[0].ent_status }">
	  	  </#if>
  	  </#list>
	  </#if>
	    <img src="${base}/resources/images/box1.png" alt="box1.png"/><br/><br/>
        <b class="time">急招 <font color="#FF0000"><span></span><em></em></font></b>
	  </a>
	  <a href="${base}/postoffice">
	    <img src="${base}/resources/images/box2.png" alt="box2.png"/><br/><br/>
	    <b>发布职位</b>
	  </a>
	  <a class="finance" href="${base}/ownjob">
	    <img src="${base}/resources/images/box3.png" alt="box3.png"/><br/><br/>
	    <b>我的职位</b>
	  </a>
	</p>
  </div>
  
 </div>
 <!--/.showbox-->

 <!--清浮动-->
 <div style="clear:both"></div>
 
</div>
<!--/.contaniner-->
    

<#include "../common/bottom.ftl">
<script>
	$(function(){
		getJson_education();
		getJson_job_type();
		getJson_work_experience();
		getJson_major();
		getJson_city();
		
		timeCounter();
		
		//专业联动
		$("#major_list").change(function(){
			getJson_child_major($(this).val());
		})
	});
	
	//倒计时
	var timeCounter = (function() {
		 var ints;
		 var total = 3600;
		 total = total*parseInt('${hour}')+parseInt('${min}')*60+parseInt('${sec}');
		 return function(hour) {
			  var s = (total%60) < 10 ? ('0' + total%60) : total%60;
			  var h = total/3600 < 10 ? ('0' + parseInt(total/3600)) : parseInt(total/3600);
			  var m = (total-h*3600)/60 < 10 ? ('0' + parseInt((total-h*3600)/60)) : parseInt((total-h*3600)/60);
			  if(total > 0){
				  $(".time span").html("剩余"+h + ":" + m + ":" + s);
			  }
			 total--;
			 ints = setTimeout("timeCounter()",1000);
			  if(total < 0){
				  clearTimeout(ints);
			  } 
			 }
	})();
	//学历
	function getJson_education(){
	    	var reqURL="${base}/resources/json/education.json";
	    	$.getJSON(reqURL,function(data){
	    		$("#education").empty();
	    		$("#education").append("<option value='-1' selected>不限</option>");
				$(data).each(function(){
					$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
					$("#education").append($option);
				})
			});
	};
	
	//职位类型
	function getJson_job_type(){
	    	var reqURL="${base}/resources/json/job_type.json";
	    	$.getJSON(reqURL,function(data){
	    		$("#job_type").empty();
	    		$("#job_type").append("<option value='-1' selected>不限</option>");
				$(data).each(function(){
					$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
					$("#job_type").append($option);
				})
			});
	};
	
	//工作经验
	function getJson_work_experience(){
	    	var reqURL="${base}/resources/json/work_experience.json";
	    	$.getJSON(reqURL,function(data){
	    		$("#work_experience").empty();
	    		$("#work_experience").append("<option value='0' selected>不限</option>");
				$(data).each(function(){
					$option = $("<option value='"+this.label+"'>"+this.value+"</option>");
					$("#work_experience").append($option);
				})
			});
	};
	
	//专业列表-1
	function getJson_major(){
		var reqURL="${base}/major_list";
    	$.getJSON(reqURL,function(data){
    		$("#major_list").empty();
    		$("#major_list").append("<option selected='selected' value='0'>不限</option>");
			$(data.data).each(function(){
				if(this.name!="其他"){
					$("#major_list").append("<option value='"+this.id+"'>"+this.name+"</option>");
				}
			})
		});
	}
	//专业列表-2
	function getJson_child_major(id){
		if(id!=0){
			var reqURL="${base}/major_list";
	    	$.getJSON(reqURL,{
	    		id : id
	    	},function(data){
	    		$("#child_major").empty();
	    		$("#child_major").append("<option selected='selected' value='0'>不限</option>");
				$(data.data).each(function(){
					$("#child_major").append("<option value='"+this.id+"'>"+this.name+"</option>");
				})
			});
		}else{
			$("#child_major").empty();
			$("#child_major").append("<option selected='selected' value='0'>不限</option>");
		}
	}
	
	
	//城市列表
	function getJson_city(){
		var reqURL="${base}/city_list";
    	$.getJSON(reqURL,function(data){
    		$("#city").empty();
    		$("#city").append("<option selected='selected' value='0'>不限</option>");
			$(data.data).each(function(){
				$("#city").append("<option value='"+this.id+"'>"+this.name+"</option>");
			})
		});
	}
	
	//轮播
	$(".prev,.next").hover(function(){
		$(this).stop(true,false).fadeTo("show",0.9);
	},function(){
		$(this).stop(true,false).fadeTo("show",0.4);
	});
	$(".banner-box").slide({
		titCell:".hd ul",
		mainCell:".bd ul",
		effect:"fold",
		interTime:3500,
		delayTime:500,
		autoPlay:true,
		autoPage:true, 
		trigger:"click" 
	});
	
	function erroremergentMsg(){
		layer.alert("企业未设置急招职位", {icon: 7,skin: 'layer-ext-moon'});
	}
	
	function correctEmergent(){
		var reqURL="${base}/checkEme";
		$.post(reqURL,function(data){
			if(data.success){
				location.href="${base}/emergent";
			}else{
				layer.alert("企业未设置急招职位", {icon: 0,skin: 'layer-ext-moon'});
			}
		});
	}
	
	function search(){
		if($("#major_list option:selected").val() !=0 && $("#child_major option:selected").val()==0){
			layer.alert("请选择二级专业", {icon: 0,skin: 'layer-ext-moon'});
		}else{
			$('#searchForm').submit();
		}
	}
</script>
</body>
</html>